import {DEFAULT_COLOR_TITLE} from "~background/constants";
import getColorOptions from "~background/actions/getColorOptions";


const getCurrentColor = async () => {
  const { color } = await chrome.storage.sync.get("color");
  const colorTitle = color || DEFAULT_COLOR_TITLE;
  const colorOptions = await getColorOptions();
  return colorOptions.find((colorOption) => colorOption.title === colorTitle) || colorOptions[0];
}

export default getCurrentColor;
